package dic.action;

import java.util.List;
import java.util.Map;

import net.sf.json.JSONObject;

import com.opensymphony.xwork2.ActionSupport;

import dic.manage.DicManage;
import dic.model.City;
/*
 * 用于字典的处理action
 * 
 */
public class DicAction extends ActionSupport {

	private DicManage dicManage=null;
	private int id;
	private JSONObject result;
	private Map<String,List<City>> provinceCityMap=null;
	private List listDredgeCitys=null;
	private int flag;
	
	@Override
	public String execute() throws Exception {
		return super.execute();
	}
	/**
	 *  获得省列表
	 */
	public String getProvince()
	{
		result=dicManage.getProvince();
		return "success";
	}
	/**
	 *  获得省列表
	 */
	public String getCity()
	{
		result=dicManage.getCity(id);
		return "success";
	}
	/**
	 * 获得城市列表
	 */
	public String getProvinceCity()
	{
		provinceCityMap=dicManage.getProvinceCityList();
		return "success";
	}
	/**
	 * 获得城市列表
	 */
	public String dredge()
	{
		result=dicManage.dredge(id);
		return "success";
	}
	/**
	 * 获得开放城市列表
	 */
	public String getDredgeCitys()
	{
		listDredgeCitys=dicManage.getDredgeCitys();
		
		return "success";
	}
	/**
	 * 获得开放城市列表
	 */
	public String getDredgeCitysOption()
	{
		result=dicManage.getDredgeCitysOption();
		
		return "success";
	}
	/**
	 * 获得类别
	 * @return
	 */
	public String getCategoryList()
	{
		result=dicManage.getCategoryList(flag);
		return "success";
	}
	public DicManage getDicManage() {
		return dicManage;
	}
	public void setDicManage(DicManage dicManage) {
		this.dicManage = dicManage;
	}
	public Map<String, List<City>> getProvinceCityMap() {
		return provinceCityMap;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public JSONObject getResult() {
		return result;
	}
	public List getListDredgeCitys() {
		return listDredgeCitys;
	}
	public int getFlag() {
		return flag;
	}
	public void setFlag(int flag) {
		this.flag = flag;
	}
	

}
